Vue.component('myheader', {
    props:["category","user"],
    template: `
        <nav class="navbar navbar-default">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="../../index.html">
                        <img alt="Brand" src="../../logo.png">
                    </a>
                </div>
                <!--分类开始-->
                <ul class="nav navbar-nav">
                    <li><a href="../../index.html">首页</a></li>
                    <li v-for="cat in category"><a v-text="cat.catName" :href="'../../series.html?'+cat.id">送礼系列</a></li>
                    <li><a href="../../series.html">全部商品</a></li>
                    <li class="nav navbar-nav">
                        <form action="">
                            <input type="text" placeholder="Search">
                            <button><i class="fa fa-search"></i></button>
                        </form>
                    </li>
                </ul>
                <!--分类结束-->
                <!--用户未登录-->
                <ul class="nav navbar-nav navbar-right" style="margin-right: 30px" v-if="user == ''">
                    <li><a href="/login.html">登录</a></li>   
                </ul>
                <!--用户已登录-->
                <a href="/address.html" class="nav navbar-nav navbar-right" v-if="user != ''"  id="avatar">
                    <img src="../../image/cat.png" class="img-circle" style="width: 50px; height: 50px;" alt="">
                </a>
            </div>
        </nav>
    `,
})